/*
 * FaceText.h
 *
 *  Created on: 2018年8月13日
 *      Author: zhengboyuan
 */

#ifndef FACETEXT_H_
#define FACETEXT_H_

#include "BasicType.h"
#include <string>
#include <vector>
#include <json\json.h>


class FaceText
{
public:
	
	struct Rect
	{
		double left;
		double top;
		double right;
		double bottom;

		Rect():
			left(),
			top(),
			right(),
			bottom()
		{
		}
	};

	struct Remark
	{
		double x;
		double y;
		std::string	text;

		Remark():
			x(),
			y(),
			text()
		{
		}
	};

	struct Face : public Rect, Remark
	{

	};

	typedef std::vector< Face >	FaceArray;

	enum FontType
	{
		kSun = 0,
		kArial = 1
	};

	enum Gender
	{
		kMale = 1,
		kFemale = 0
	};

	enum Age
	{
		kChildren = 0,
		kYouth,
		kMiddleAge,
		kOldPeople
	};

	enum Race
	{
		kWhite = 0,
		kChinese = 1,
		kBlack
	};

public:
    FaceText();
    virtual ~FaceText();

	bool empty();

	bool parse(Json::Value& json);

	void clear();

	int64_t m_frameId;
	DWORD m_lineColor;
	int	  m_lineSize;
	DWORD m_fontColor;
	DWORD m_fontType;
	int m_fontSize;
	
	FaceArray m_faces;



	std::string parseRemark(const std::string& remark);

	const char* getGender(const std::string& str);
	const char* getAge(const std::string& str);
	const char* getRace(const std::string& str);

};

#endif /* FACETEXT_H_ */
